package com.cloud.api.domain.sys;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cloud.core.entity.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * <p>
 * 部门表
 * </p>
 *
 * @author haohaibo
 * @since 2023-08-01
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_dept")
@Schema(name = "SysDept", description = "部门表")
public class SysDept extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "部门id")
    @TableId("dept_id")
    private String deptId;

    @Schema(description = "父部门id")
    @TableField("parent_id")
    private String parentId;

    @Schema(description = "祖级列表")
    @TableField("ancestors")
    private String ancestors;

    @Schema(description = "描述")
    @TableField("description")
    @Size(max = 50,message = "限制50位字符")
    private String description;

    @Schema(description = "部门名称")
    @TableField("dept_name")
    @Size(max = 30,message = "限制30位字符")
    private String deptName;

    @Schema(description = "部门类型，由字典控制")
    @TableField("dept_type")
    private String deptType;

    @Schema(description = "显示顺序")
    @TableField("order_num")
    private Integer orderNum;

    @Schema(description = "负责人")
    @TableField("leader")
    @Size(max = 8,message = "限制8位字符")
    private String leader;

    @Schema(description = "联系电话")
    @TableField("phone")
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$",message = "手机号码格式错误")
    private String phone;

    @Schema(description = "邮箱")
    @TableField("email")
    private String email;

    @Schema(description = "部门状态（0正常 1停用）")
    @TableField("enable")
    private Integer enable;


}